<?php
/* 
* [***********************]
* @author: mazhenyu[houdunwangmzy@163.com]
* @Date:   2014-06-23 16:04:01
* @Last Modified time: 2014-06-25 17:15:28
*/
class RegControl extends CommonControl{



	public function index(){
		$this->dis('reg.html');
		if(IS_POST){
			if(K('User')->check_user(htmlspecialchars($_POST['username']))){
				$this->error('用户名不可用','');
			}
			
			$data = array(
			'username'=>htmlspecialchars($_POST['username']),
			'password'=>htmlspecialchars(md5($_POST['password'])),
			
			);
			
			$result = K('User')->_add($data);
			if($result){
				$this->success('注册成功','Logo/index');
			}else{
				$this->error('注册出错','');
			}
		}
	}

}
?>
